package cn.zh.org.service.impl;

import cn.zh.org.domain.Department;
import cn.zh.org.mapper.DepartmentMapper;
import cn.zh.org.service.IDepartmentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class DepartmentServiceImpl implements IDepartmentService {

    @Autowired
    private DepartmentMapper mapper;

    @Override
    public List<Department> findAll() {
        List<Department> all = mapper.findAll();
        return all;
    }

    @Override
    public Department findById(Long id) {
        Department department = mapper.findById(id);
        return department;
    }

    @Override
    public void add(Department department) {
        mapper.add(department);
    }

    @Override
    public void delete(Long id) {
        mapper.delete(id);
    }

    @Override
    public void update(Department department) {
        mapper.update(department);
    }
}
